package com.gistone.commis.entity;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.ToString;

import lombok.*;
/**
 * Created by wangfan on 2017/5/9.
 */
@Setter
@Getter

@ToString
@AllArgsConstructor
@NoArgsConstructor
public class PersonLog {

    private Integer logId;

    private Integer personId;

    private Integer communityId;
    private  Community community;

    private Integer departId;
    private  Depart depart;

    private Integer userId;
    private User user;

    private String personName;

    private String personPolitica;

    private String nationality;
    @JsonFormat(pattern="yyyy-MM-dd")
    private Date sWorkDate;

    private String householdAddr;

    private String liveAddr;

    private String familyPhone;

    private String mobilePhone;

    private String cardCode;

    private String icetuCode;

    private Integer ccId;
    private PersonCc personCc;
    private Integer positionId;
    private PositionType positionType;

    private String enlistType;

    private Integer isIntern;

    private Integer isDszn;

    private String liveCommunity;

    private String liveAvenue;
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date registerTime;
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    private Integer updateUserId;
    private  User alterUser;
    private String sex;
    @JsonFormat(pattern="yyyy-MM-dd")
    private Date birthday;

    private String education;

    private  Date dsznDeadline;

    public PersonLog(Integer logId, Integer personId, Integer communityId, Integer departId, Integer userId, String personName, String personPolitica, String nationality, Date sWorkDate, String householdAddr, String liveAddr, String familyPhone, String mobilePhone, String cardCode, String icetuCode, Integer ccId, Integer positionId, String enlistType, Integer isIntern, Integer isDszn, String liveCommunity, String liveAvenue, Date registerTime, Date updateTime, Integer updateUserId, String sex, Date birthday, String education,Date dsznDeadline) {
        this.logId = logId;
        this.personId = personId;
        this.communityId = communityId;
        this.departId = departId;
        this.userId = userId;
        this.personName = personName;
        this.personPolitica = personPolitica;
        this.nationality = nationality;
        this.sWorkDate = sWorkDate;
        this.householdAddr = householdAddr;
        this.liveAddr = liveAddr;
        this.familyPhone = familyPhone;
        this.mobilePhone = mobilePhone;
        this.cardCode = cardCode;
        this.icetuCode = icetuCode;
        this.ccId = ccId;
        this.positionId = positionId;
        this.enlistType = enlistType;
        this.isIntern = isIntern;
        this.isDszn = isDszn;
        this.liveCommunity = liveCommunity;
        this.liveAvenue = liveAvenue;
        this.registerTime = registerTime;
        this.updateTime = updateTime;
        this.updateUserId = updateUserId;
        this.sex = sex;
        this.birthday = birthday;
        this.education = education;
        this.dsznDeadline= dsznDeadline;
    }


    public PersonLog(Person p,Date updateTime, Integer updateUserId) {
        this.personId=p.getPersonId();
        this.personId=p.getPersonId();
        this.communityId=p.getCommunityId();
        this.departId=p.getDepartId();
        this.userId=p.getUserId();
        this.personName=p.getPersonName();
        this.personPolitica=p.getPersonPolitica();
        this.nationality=p.getNationality();
        this.sWorkDate=p.getSWorkDate();
        this.householdAddr=p.getHouseholdAddr();
        this.liveAddr=p.getLiveAddr();
        this.familyPhone=p.getFamilyPhone();
        this.mobilePhone=p.getMobilePhone();
        this.cardCode=p.getCardCode();
        this.icetuCode=p.getIcetuCode();
        this.ccId=p.getCcId();
        this.positionId=p.getPositionId();
        this.enlistType=p.getEnlistType();
        this.isIntern=p.getIsIntern();
        this.isDszn=p.getIsDszn();
        this.liveCommunity=p.getLiveCommunity();
        this.liveAvenue=p.getLiveAvenue();
        this.registerTime=p.getRegisterTime();
        this.updateTime = updateTime;
        this.updateUserId = updateUserId;
        this.sex = p.getSex();
        this.birthday = p.getBirthday();
        this.education = p.getEducation();
        this.dsznDeadline =p.getDsznDeadline();
    }
}